package com.ty.baobao.service;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ty.baobao.mapper.CatalogMapper;
import com.ty.baobao.pojo.Catalog;

@Service
public class CatalogServiceImpl implements CatalogService {
	@Autowired
	private CatalogMapper catalogMapper;
	
	@Override
	public void add(Catalog catalog) {
		//记录时间
		Date now = new Date();
		catalog.setGmtCreate(now);
		catalog.setGmtUpdated(now);
		catalogMapper.insert(catalog);
	}

	@Override
	public List<Catalog> getCatalogsByPid(long pid) {
		return catalogMapper.selectByPid(pid);
	}

}
